package edu.hzau.xiahui.constants;

import com.google.common.collect.Lists;
import edu.hzau.xiahui.vo.InsuranceThreshold;
import edu.hzau.xiahui.vo.TaxStep;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

public interface Constants {
    int YEAR = 12;
    BigDecimal MONTH_TAX_FREE = new BigDecimal(5000);
    BigDecimal YEAR_TAX_FREE = MONTH_TAX_FREE.multiply(new BigDecimal(YEAR));
    BigDecimal DEGREE_EDU = new BigDecimal(400);
    List<TaxStep> YEAR_TAX_STEPS = Lists.newArrayList(
            new TaxStep(new BigDecimal(36000), new BigDecimal("0.03"), new BigDecimal(0)),
            new TaxStep(new BigDecimal(144000), new BigDecimal("0.1"), new BigDecimal(2520)),
            new TaxStep(new BigDecimal(300000), new BigDecimal("0.2"), new BigDecimal(16920)),
            new TaxStep(new BigDecimal(420000), new BigDecimal("0.25"), new BigDecimal(31920)),
            new TaxStep(new BigDecimal(660000), new BigDecimal("0.3"), new BigDecimal(52920)),
            new TaxStep(new BigDecimal(960000), new BigDecimal("0.35"), new BigDecimal(85920)),
            new TaxStep(new BigDecimal(Integer.MAX_VALUE), new BigDecimal("0.45"), new BigDecimal(181920))
    );
    List<TaxStep> BONUS_TAX_STEPS = Lists.newArrayList(
            new TaxStep(new BigDecimal(3000), new BigDecimal("0.03"), new BigDecimal(0)),
            new TaxStep(new BigDecimal(12000), new BigDecimal("0.1"), new BigDecimal(210)),
            new TaxStep(new BigDecimal(25000), new BigDecimal("0.2"), new BigDecimal(1410)),
            new TaxStep(new BigDecimal(35000), new BigDecimal("0.25"), new BigDecimal(2660)),
            new TaxStep(new BigDecimal(55000), new BigDecimal("0.3"), new BigDecimal(4410)),
            new TaxStep(new BigDecimal(80000), new BigDecimal("0.35"), new BigDecimal(7160)),
            new TaxStep(new BigDecimal(Integer.MAX_VALUE), new BigDecimal("0.45"), new BigDecimal(15160))
    );
    Map<String, InsuranceThreshold> INSURANCE_THRESHOLDS = Lists.newArrayList(
        new InsuranceThreshold("wuhan", new BigDecimal[]{new BigDecimal(4494), new BigDecimal(22467)}, new BigDecimal[]{new BigDecimal(2210), new BigDecimal("33555.25")})
    ).stream().collect(Collectors.toMap(k -> k.location, Function.identity()));
}
